-
-
Notifications
You must be signed in to change notification settings - Fork 206
Support Pydantic model defaults + field descriptions #802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Should Pydantic support for pdoc be split out into a separate "plugin" package, e.g. pdoc-pydantic or pdoc[pydantic]?
Too much complexity for now. I think pydantic is popular enough to have support for it builtin for now.
Is this the best place for default-value-extraction logic for Pydantic classes to live?
Pragmatically yes. See my comments below on how we can keep things reasonably clean.
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! This looks great overall. Mostly some minor stylistic nits.
Co-authored-by: Maximilian Hils <[email protected]>
@mhils: This is ready for your eyes again! |
Contributes to #793.
This PR implements quick-and-dirty support for Pydantic-style default values and field descriptions. In other words, the following two classes will render equivalently:
Open questions:
pdoc-pydantic
orpdoc[pydantic]
?